package producersConsumersTests.utils;

import prod_cons.TaskContainer;

public class CounterRemover extends Remover {
	private volatile long taskCounter = 0;
	
	public CounterRemover(TaskContainer container) {
		super(container);
	}
	
	@Override
	protected void afterGetAttempt(Runnable task) {
		if (task != null)
			taskCounter++;
	}
	
	public long getTaskCount() {
		return taskCounter;
	}

	public void zeroCounter() {
		this.taskCounter = 0;
	}
}
